#include <glib.h>

static void g_quark_intern_string_test(void)
{
    gchar *str = "abcd";
    gchar *str1 = NULL;
    gchar *str2 = NULL;

    str1 = (gchar *)g_intern_string(str);
    str2 = (gchar *)g_intern_string(str);

    g_print("str(%p):%s, str1(%p):%s, str2(%p):%s \n", \
        str, str, str1, str1, str2, str2);
}

static void g_quark_intern_static_string_test(void)
{
    gchar *str = "xyz";
    gchar *str1 = NULL;
    gchar *str2 = NULL;

    str1 = (gchar *)g_intern_static_string(str);
    str2 = (gchar *)g_intern_static_string(str);

    g_print("str(%p):%s, str1(%p):%s, str2(%p):%s \n", \
        str, str, str1, str1, str2, str2);
}


gint main (gint argc, gchar** argv)
{
    g_quark_intern_string_test();
    g_quark_intern_static_string_test();

    return 0;
}
